home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / Localization Tools / Localization using ResEdit™ 3.0 / Plugin for ODF 3 / Plugin for ODF 3.rsrc / EDL_129_Resource.FWvl < prev    next >
Encoding:
Text File  |  1996-12-11  |  6.3 KB  |  362 lines

  1. //========================================================================================
  2. //
  3. // Exploder description for 'FWvl' (ODF view layout) resources
  4. //
  5. // Author:     Steve Crutchfield
  6. //
  7. // Copyright:  (c) 1996 by Apple Computer, Inc., all rights reserved.
  8. //
  9. //        The EDL and VDL code describing this resource type rely heavily
  10. //        on the use of class labels (four-character codes) used by
  11. //        ODF's archiver.  However, the base FrameLayout object is not
  12. //        archivable and thus has no class label.  In order to preserve
  13. //        the symmetry requried by ResEdit's recursive "SELF" command,
  14. //        a dummy class label ('root') is inserted at the top level of
  15. //        the view hierarchy by a plug-in command.
  16. //
  17. //========================================================================================
  18.  
  19. ArchivableHeader();  // custom plugin routine--adds 10 bytes including 'root' tag
  20.                             // to top level of hierarchy
  21.  
  22. //----------------------------------------------------------------------------
  23. // The following definitions are adapted almost directly from the ODFRC 
  24. // type definitions to which they correspond.
  25. //----------------------------------------------------------------------------
  26.  
  27. Define(FW_RView)
  28. {
  29.     Word(fObjectTag);
  30.     Long(fObjectID);
  31.     PadWord();
  32.     Long(fParentViewClass);
  33.     PadWord();
  34.     Long(fParentViewID);
  35.     Long(fViewID);
  36.     Long(fLeft);
  37.     Long(fTop);
  38.     Long(fRight);
  39.     Long(fBottom);
  40.     Long(fBinding);
  41. }
  42.  
  43. Define(FW_RSuperView)
  44. {
  45.     Call(FW_RView);
  46.  
  47.     Long(fExtentX);
  48.     Long(fExtentY);
  49.     Byte(fIsContentView);
  50.     Word(fScrollingDirection);
  51.     
  52.     List(fViews, View, OneBasedCount(16))
  53.         SELF;
  54. }
  55.  
  56. Define(FW_RArchivableObject)
  57. {
  58.     Word(fClassTag);
  59.     Long(fClassID);
  60.     Long(fLabel);
  61.     Word(fObjectTag);
  62.     Long(fObjectID);
  63. }
  64.  
  65. Define(FW_RRadioCluster)
  66. {
  67.     Call(FW_RArchivableObject);
  68.     
  69.     PadWord();
  70.     Long(fViewClass);
  71.     PadWord();
  72.     Long(fViewID);
  73.     PadLong();
  74.     
  75.     List(fRadioArray, RadioEntry, OneBasedCount(16))
  76.         Long(fRadioID);
  77. }
  78.  
  79. Define(FW_RControl)
  80. {
  81.     Call(FW_RView);
  82.     
  83.     Long(fMessage);
  84.     Word(fReceiver);
  85.     Long(fInitialValue);
  86. }
  87.  
  88. Define(FW_RButton)
  89. {
  90.     Call(FW_RControl);
  91.     
  92.     Long(fButtonKind);
  93.  
  94.     Call(FW_RFont);
  95.     Call(FW_RStringData);
  96. }
  97.  
  98. Define(FW_RPopupMenu)
  99. {
  100.     Call(FW_RControl);
  101.     
  102.     Word(fMacMenuID);
  103.     Word(fTitleWidth);
  104.     Word(fInitialMenuItem);
  105.     Word(fMenuVariation);
  106.     Long(fMenuRefCon);
  107.     
  108.     Call(FW_RFont);
  109.     Call(FW_RStringData);
  110. }
  111.  
  112. Define(FW_RScrollBar)
  113. {
  114.     Call(FW_RControl);
  115.     
  116.     Word(fMinValue);
  117.     Word(fMaxValue);
  118.     Long(fMajorUnits);
  119.     Long(fMinorUnits);
  120. }
  121.  
  122. Define(FW_RListBox)
  123. {
  124.     Call(FW_RView);
  125.     
  126.     Word(fNumRows);
  127.     Byte(fVerticalSB);
  128.     Byte(fSingleSelection);
  129.     Byte(fUseFocusFrame);
  130.     Byte(fUseClientData);
  131.     Long(fDblClickMessage);
  132.     
  133.     Call(FW_RFont);
  134.     
  135.     List(fStrings, String, OneBasedCount(16))
  136.         Call(FW_RStringData);
  137. }
  138.  
  139. Define(FW_RStaticText)
  140. {
  141.     Call(FW_RView);
  142.     Call(FW_RFont);
  143.     
  144.     // Comment out the next line if you're editing an ODF 1 part.
  145.     Call(FW_RColor);
  146.     
  147.     Call(FW_RStringData);
  148. }
  149.  
  150. Define(FW_REditView)
  151. {
  152.     Call(FW_RView);
  153.     
  154.     Word(fMaxChars);
  155.     Word(fAttributes);
  156.     
  157.     Call(FW_RFont);
  158.     Call(FW_RStringData);
  159. }
  160.  
  161. Define(FW_RPictSView)
  162. {
  163.     Call(FW_RSuperView);
  164.     
  165.     Word(fPictureID);
  166. }
  167.  
  168. Define(FW_RFont)
  169. {
  170.     Long(fFontSize);
  171.     Word(fFontStyle);
  172.     
  173.     // Using a list here is a workaround.  A better solution would
  174.     // be to use an Element(); however, there is no structure in
  175.     // VDL which causes all identifiers within its scope to
  176.     // apply to a sub-element rather than the containing element.
  177.     // DynamicVList performs this task for a list, so we use a
  178.     // single-element list here.  This is needed because both
  179.     // FW_RFont and FW_RStringData contain script and language
  180.     // code fields, which must have the same name in each case so
  181.     // that a single VDL named statement can be used to generate all
  182.     // script/language code popup menus.
  183.     
  184.     List(fFontName, String, 1)
  185.     {
  186.         Word(fScriptCode);
  187.         Word(fLanguageCode);
  188.         String(fFontName, LengthWord);
  189.     }
  190. }
  191.  
  192. Define(FW_RStringData)
  193. {
  194.     // Use of List is a workaround; see comment in FW_RFont, above.
  195.     
  196.     List(fString, String, 1)
  197.     {
  198.         Word(fScriptCode);
  199.         Word(fLanguageCode);
  200.         String(fString, LengthWord);
  201.     }
  202. }
  203.  
  204. Define(FW_RColor)
  205. {
  206.     Word(fRed);
  207.     Word(fGreen);
  208.     Word(fBlue);
  209. }
  210.  
  211. Define(FW_RScroller)
  212. {
  213.     PadWord();
  214.     Long(fEnclosureFrameClass);
  215.     PadWord();
  216.     Long(fEnclosureFrameID);
  217.     Long(fAutoScrollInset);
  218.     Long(fScrollUnitX);
  219.     Long(fScrollUnitY);
  220.             
  221.     // Comment out the next line if you're editing an
  222.     // ODF 1 part.
  223.     
  224.     Byte(fPageNavigationKeys);
  225. }
  226.  
  227. Define(FW_RScrollBarScroller)
  228. {
  229.     Call(FW_RScroller);
  230.  
  231.     // Comment out the next line if you're editing an
  232.     // ODF 1 part.
  233.     
  234.     Byte(fLiveScrolling);
  235.     
  236.     Long(fHorizViewID);
  237.     Long(fVertViewID);
  238. }
  239.  
  240. //----------------------------------------------------------------------------
  241. // Main definition begins here.
  242. //----------------------------------------------------------------------------
  243.  
  244. Switch(fLabel)
  245. {
  246.     case 'root':
  247.     {
  248.         Long(fLayoutSizeX);
  249.         Long(fLayoutSizeY);
  250.         
  251.         List(fViews, View, OneBasedCount(16))
  252.             SELF;  // root FrameLayout contains a list of views,
  253.                      // each of which can be of any of the types
  254.                      // present in 'case' statements below
  255.  
  256.         List(fScrollers, Scroller, OneBasedCount(16))
  257.         {
  258.             Call(FW_RArchivableObject);
  259.             
  260.             Switch(fLabel)
  261.             {
  262.                 case 'sclr':
  263.                 {
  264.                     Call(FW_RScroller);
  265.                 }
  266.                 
  267.                 case 'sbsc':
  268.                 {
  269.                     Call(FW_RScrollBarScroller);
  270.                 }
  271.             }
  272.         }
  273.     }
  274.     
  275.     // The following 'case' statements all represent
  276.     // standard view types.
  277.     
  278.     case 'view':
  279.     case 'grbx':
  280.     {
  281.         Call(FW_RView);
  282.     }
  283.     
  284.     case 'suvw':
  285.     case 'rulr':
  286.     case 'drvw':
  287.     case 'ctvw':
  288.     {
  289.         Call(FW_RSuperView);
  290.     }
  291.     
  292.     case 'cont':
  293.     case 'ncnt':
  294.     {
  295.         Call(FW_RControl);
  296.     }
  297.     
  298.     case 'butn':
  299.     {
  300.         Call(FW_RButton);
  301.     }
  302.     
  303.     case 'popm':
  304.     {
  305.         Call(FW_RPopupMenu);
  306.     }
  307.     
  308.     case 'scbr':
  309.     {
  310.         Call(FW_RScrollBar);
  311.     }
  312.     
  313.     case 'lbox':
  314.     {
  315.         Call(FW_RListBox);
  316.     }
  317.     
  318.     case 'stxt':
  319.     case 'gpbx':
  320.     {
  321.         Call(FW_RStaticText);
  322.     }
  323.     
  324.     case 'picv':
  325.     {
  326.         Call(FW_RPictSView);
  327.     }
  328.     
  329.     case 'edvw':
  330.     
  331.     // The following 'case' statements all represent
  332.     // custom view types.  'Pwdv' doesn't extend 'edvw'
  333.     // at all and thus shares a definition with it; the
  334.     // other custom types extend the standard types in
  335.     // some way.  You can add your own custom types here
  336.     // in a similar manner.
  337.     
  338.     case 'Pwdv':
  339.     {
  340.         Call(FW_REditView);
  341.     }
  342.     
  343.     case 'Sedv':
  344.     {
  345.         Call(FW_REditView);
  346.         
  347.         Long(fHorizViewID);
  348.         Long(fVertViewID);
  349.         Long(fTextWidth);
  350.     }
  351.     
  352.     case 'Frmv':
  353.     {
  354.         Call(FW_RPictSView);
  355.         
  356.         Word(fPicture2);
  357.         
  358.         List(fRadioClusters, RadioCluster, 3)
  359.             Call(FW_RRadioCluster);  // list of 3 radio clusters
  360.     }
  361. }
  362.